package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseIdEntity;
import com.ruoyi.common.utils.StringUtils;
import lombok.Data;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;

import java.util.Date;

/**
 * 设备电压等级对象 s_device_voltage_level
 * 
 * @author ruoyi
 * @date 2023-07-05
 */
@Data
@ApiModel(value = "SDeviceVoltageLevel", description = "设备电压等级对象")
public class SDeviceVoltageLevel extends BaseIdEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @ApiModelProperty("id")
    private String id;

    /** 设备电压等级 */
    @Excel(name = "设备电压等级")
    @ApiModelProperty("设备电压等级")
    private String deviceVoltageLevel;

    /** 创建者 */
    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty("创建者")
    private String createBy;

    /** 创建时间 */
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty("更新者")
    private String updateBy;

    /** 更新时间 */
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public <T> QueryWrapper<T> queryWrapper(){
        QueryWrapper<T> wrapper=new QueryWrapper<>();

        wrapper.like(StringUtils.isNotEmpty(id),"id" , id);
        wrapper.like(StringUtils.isNotEmpty(deviceVoltageLevel),"device_voltage_level" , deviceVoltageLevel);
        wrapper.orderByDesc("create_time");
        return wrapper;
    }

}
